<?php
/**
 * I-Cafe framework
 * 
 * @category CF
 * @package CF_Plugin
 * @link http://www.i-cafe.org
 * @license http://www.i-cafe.org/license
 * @version 04-04-2010
 * @author tcl_java@yahoo.com
 */

abstract class CF_Plugin_Abstract extends CF_Observable
{
	/**
	 * 
	 * @var string
	 */
	protected $_name = null;
	
	/**
	 * 
	 * @var CF_Component
	 */
	protected $_component;
	
	/**
	 * 
	 * @return void
	 */
	public function __construct()
	{
		
	}
	
	/**
	 * @return CF_Component
	 */
	public function getComponent()
	{
		return $this->_component;
	}
	
	/**
	 * @todo sub class override this method
	 * @param CF_Component $component
	 * @return mixed
	 */
	public function init(CF_Component $component)
	{
		return $this;
	}
	
	public function __toString()
	{
		if(null === $this->_name) $this->_name = get_class($this);
		return $this->_name;
	}
}